home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 1.iso / dist / fw_ddd.idb / usr / freeware / share / ddd-3.3.1 / vsllib / ddd.vsl.z / ddd.vsl
Text File  |  2001-10-09  |  8KB  |  284 lines

  1. // $Id: ddd.vsl.m4,v 1.20 2000/06/16 16:43:58 andreas Exp $ -*- c++ -*-
  2. // VSL functions for DDD graph display
  3. // Generated automatically from ddd.vsl.m4 by m4.  DO NOT EDIT.
  4.  
  5. // Copyright (C) 1995-1998 Technische Universitaet Braunschweig, Germany.
  6. // Written by Andreas Zeller <zeller@gnu.org>.
  7. // 
  8. // This file is part of DDD.
  9. // 
  10. // DDD is free software; you can redistribute it and/or
  11. // modify it under the terms of the GNU General Public
  12. // License as published by the Free Software Foundation; either
  13. // version 2 of the License, or (at your option) any later version.
  14. // 
  15. // DDD is distributed in the hope that it will be useful,
  16. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  18. // See the GNU General Public License for more details.
  19. // 
  20. // You should have received a copy of the GNU General Public
  21. // License along with DDD -- see the file COPYING.
  22. // If not, write to the Free Software Foundation, Inc.,
  23. // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  24. // 
  25. // DDD is the data display debugger.
  26. // For details, see the DDD World-Wide-Web page, 
  27. // `http://www.gnu.org/software/ddd/',
  28. // or send a mail to the DDD developers <ddd@gnu.org>.
  29.  
  30. // Includes
  31. #include "std.vsl"
  32. #include "tab.vsl"
  33. #include "fonts.vsl"
  34. #include "colors.vsl"
  35. #include "list.vsl"
  36.  
  37. // Font settings
  38. #pragma replace stdfontfamily
  39. stdfontfamily() = family_typewriter();
  40.  
  41. // Small fonts.
  42. // Note: ALL THESE DEFINITIONS WILL BE OVERRIDDEN BY DDD.
  43. // Use `ddd --fonts' to see the actual definitions.
  44. small_size()  = (0, 100);
  45. small_rm(box) = rm(box, stdfontfamily(), small_size());
  46. small_bf(box) = bf(box, stdfontfamily(), small_size());
  47. small_it(box) = it(box, stdfontfamily(), small_size());
  48. small_bi(box) = bi(box, stdfontfamily(), small_size());
  49.  
  50. // Tiny fonts.
  51. // Note: ALL THESE DEFINITIONS WILL BE OVERRIDDEN BY DDD.
  52. // Use `ddd --fonts' to see the actual definitions.
  53. tiny_size()  = (0, 100);
  54. tiny_rm(box) = rm(box, family_helvetica(), tiny_size());
  55. tiny_bf(box) = bf(box, family_helvetica(), tiny_size());
  56. tiny_it(box) = it(box, family_helvetica(), tiny_size());
  57. tiny_bi(box) = bi(box, family_helvetica(), tiny_size());
  58.  
  59. // Colors
  60. display_color(box)   = color(box, "black", "white");
  61. title_color(box)     = color(box, "black");
  62. disabled_color(box)  = color(box, "white", "grey50");
  63. simple_color(box)    = color(box, "black");
  64. text_color(box)      = color(box, "black");
  65. pointer_color(box)   = color(box, "blue4");
  66. struct_color(box)    = color(box, "black");
  67. list_color(box)      = color(box, "black");
  68. array_color(box)     = color(box, "blue4");
  69. reference_color(box) = color(box, "blue4");
  70. changed_color(box)   = color(box, "black", "#ffffcc");
  71. shadow_color(box)    = color(box, "grey");
  72.  
  73. // Fonts
  74. // Note: rm, bf, it, bi will be overridden by DDD.
  75. // Use `ddd --fonts' to see the actual definitions.
  76. title_rm(box) = rm(box);
  77. title_bf(box) = bf(box);
  78. title_it(box) = it(box);
  79. title_bi(box) = bi(box);
  80.  
  81. value_rm(box) = rm(box);
  82. value_bf(box) = bf(box);
  83. value_it(box) = it(box);
  84. value_bi(box) = bi(box);
  85.  
  86. // Shadow effects
  87. shadow(box, thickness) =
  88.   box & (square(thickness) | shadow_color(vrule(thickness)))
  89. | square(thickness) & shadow_color(hrule(thickness));
  90. shadow(box) = shadow(box, 1);
  91.  
  92. // Non-expanding alignments
  93. fixed_hlist(_) = hnull();
  94. fixed_hlist(_, head) = hfix(head);
  95. fixed_hlist(sep, head, ...) = hfix(head) & sep & fixed_hlist(sep, ...);
  96.  
  97. fixed_vlist(_) = vnull();
  98. fixed_vlist(_, head) = vfix(head);
  99. fixed_vlist(sep, head, ...) = vfix(head) | sep | fixed_vlist(sep, ...);
  100.  
  101. // Titles.
  102. title (disp_nr, name) -> 
  103.   title_color(title_rm(disp_nr & ": ") & title_bf(name) & hfill());
  104. title (name) -> 
  105.   title_color(title_bf(name) & hfill());
  106.  
  107. // Edge annotations.
  108. annotation (name) ->
  109.   tiny_rm(name);
  110.  
  111. // The "disabled" string
  112. disabled () -> 
  113.   disabled_color(vcenter(value_it("(Disabled)") & hfill()));
  114.  
  115. // No value
  116. none () -> "";
  117.  
  118. // Ordinary values
  119. simple_value (value) -> 
  120.   simple_color(vcenter(value_rm(value) & hfill()));
  121. numeric_value (value) -> 
  122.   simple_color(vcenter(hfill() & value_rm(value)));
  123.  
  124. // Collapsed ordinary values
  125. collapsed_simple_value () -> 
  126.   simple_color(vcenter(value_rm("...") & hfill()));
  127.  
  128. // Info texts: single lines
  129. text_line (line) -> 
  130.   text_color(line & hfill());
  131.  
  132. // Multiple lines
  133. text_value (...) -> valign(...);
  134.  
  135. // Collapsed ordinary values
  136. collapsed_text_value () -> 
  137.   text_color(value_rm("...") & hfill());
  138.  
  139. // Ordinary pointers
  140. pointer_value (value) -> 
  141.   pointer_color(vcenter(value_rm(value) & hfill()));
  142.  
  143. // Collapsed pointers
  144. collapsed_pointer_value () -> 
  145.   pointer_color(vcenter(value_rm("...") & hfill()));
  146.  
  147. // Dereferenced pointers
  148. dereferenced_pointer_value (value) -> 
  149.   pointer_color(vcenter(value_bf(value)) & hfill());
  150.  
  151. // Collapsed array
  152. collapsed_array () -> 
  153.   array_color(vcenter(value_rm("[...]") & hfill()));
  154.  
  155. // Empty array
  156. empty_array () -> 
  157.   array_color(vcenter(value_rm("[]") & hfill()));
  158.  
  159. // Vertical array
  160. vertical_array (...) -> 
  161.   array_color(frame(indent(vlist(hwhite() | hrule() | hwhite(), ...))));
  162.  
  163. // Horizontal array
  164. horizontal_array (...) -> 
  165.   array_color(frame(indent(fixed_hlist(vwhite() & vrule() & vwhite(), ...))) 
  166.           & hfill());
  167.  
  168. // Two-dimensional arrays
  169. twodim_array (...) -> 
  170.   array_color(dtab(...));
  171. twodim_array_elem (value) -> 
  172.   value_rm(value);
  173.  
  174. // Struct value
  175. struct_value (...) -> 
  176.   struct_color(frame(indent(valign(...))));
  177.  
  178. // Collapsed struct
  179. collapsed_struct_value () -> 
  180.   struct_color(vcenter(value_rm("{...}") & hfill()));
  181.  
  182. // Empty struct
  183. empty_struct_value () ->
  184.   struct_color(vcenter(value_rm("{}") & hfill()));
  185.  
  186. // Unnamed struct
  187. horizontal_unnamed_struct (...) -> horizontal_array(...);
  188. vertical_unnamed_struct   (...) -> horizontal_array(...);
  189.  
  190. // Struct member name
  191. struct_member_name (name) -> 
  192.   struct_color(value_rm(name));
  193.  
  194. // Struct member
  195. struct_member (name, sep, value, name_width) -> 
  196.   vcenter(value_rm(name) | hspace(name_width)) 
  197.   & vcenter(value_rm(sep)) & value_rm(value);
  198.  
  199. // Same, but with suppressed member name
  200. struct_member (value) -> 
  201.   value_rm(value);
  202.  
  203. // List value
  204. list_value (...) -> 
  205.   list_color(valign(...));
  206.  
  207. // Collapsed list
  208. collapsed_list_value () -> 
  209.   list_color(vcenter(value_rm("...") & hfill()));
  210.  
  211. // Empty list
  212. empty_list_value () -> 
  213.   list_color(vcenter(value_rm("") & hfill()));
  214.  
  215. // Unnamed list
  216. horizontal_unnamed_list (...) -> horizontal_array(...);
  217. vertical_unnamed_list  (...)  -> horizontal_array(...);
  218.  
  219. // List member name
  220. list_member_name (name) -> 
  221.   list_color(value_rm(name));
  222.  
  223. // List member
  224. list_member (name, sep, value, name_width) -> 
  225.   vcenter(name | hspace(name_width)) 
  226.   & vcenter(sep) & value & hfill();
  227.  
  228. // Same, but with suppressed member name
  229. list_member (value) -> 
  230.   value;
  231.  
  232. // Sequence
  233. sequence_value (...) -> 
  234.   simple_color(fixed_hlist(vwhite(), ...) & hfill());
  235.  
  236. // Collapsed sequence
  237. collapsed_sequence_value () -> 
  238.   collapsed_simple_value();
  239.  
  240. // Reference
  241. reference_value (ref, value) -> 
  242.   reference_color(vcenter(value_rm(ref & ": ")) & value & hfill());
  243.  
  244. // Collapsed reference
  245. collapsed_reference_value () -> 
  246.   reference_color(vcenter(value_rm("...") & hfill()));
  247.  
  248. // Changed value
  249. changed_value (value) -> 
  250.   changed_color(value_it(value));
  251.  
  252. // A value that is repeated N times
  253. repeated_value (value, n) ->
  254.   value & vcenter(value_rm(" <" & dec(n) & "\327>"));
  255.  
  256. // The entire value
  257. value_box (value) -> 
  258.   value;
  259.  
  260. // The entire box
  261. display_box (title, value) -> 
  262.   fix(shadow(display_color(
  263.       frame(title | hrule() | hwhite () | value_rm(value)))));
  264.  
  265. // The entire box, but without title
  266. display_box (value) -> 
  267.   fix(shadow(display_color(frame(value_rm(value)))));
  268.  
  269. // For VSL
  270. main (_...) -> 
  271.   display_box(title("1", "pi"), value_box(simple_value("3.1415")))
  272. | display_box(title("2", "p"), value_box(pointer_value("(Object *) 0x0")))
  273. | display_box(title("3", "p"), 
  274.           value_box(dereferenced_pointer_value("(Object *) 0xdeadbeef")))
  275. | display_box(title("4", "s"), value_box(struct_value(
  276.     struct_member ("x", " = ", value_box("1"), "x"),
  277.     struct_member ("y", " = ", value_box("2"), "x"))))
  278. | display_box(title("5", "a"), 
  279.           value_box(horizontal_array(
  280.           value_box(simple_value("1")), 
  281.           value_box(simple_value("2")), 
  282.           value_box(simple_value("3")))));
  283.  
  284.